<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Datefromat | @xbb/xbb-utils</title>
	<meta name="description" content="Documentation for @xbb/xbb-utils">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading">Preparing search index...</li>
						<li class="state failure">The search index is not available</li>
					</ul>
					<a href="../index.html" class="title">@xbb/xbb-utils</a>
				</div>
				<div class="table-cell" id="tsd-widgets">
					<div id="tsd-filter">
						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
						<div class="tsd-filter-group">
							<div class="tsd-select" id="tsd-filter-visibility">
								<span class="tsd-select-label">All</span>
								<ul class="tsd-select-list">
									<li data-value="public">Public</li>
									<li data-value="protected">Public/Protected</li>
									<li data-value="private" class="selected">All</li>
								</ul>
							</div>
							<input type="checkbox" id="tsd-filter-inherited" checked />
							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
							<input type="checkbox" id="tsd-filter-externals" checked />
							<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
							<input type="checkbox" id="tsd-filter-only-exported" />
							<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
						</div>
					</div>
					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../globals.html">Globals</a>
				</li>
				<li>
					<a href="datefromat.html">Datefromat</a>
				</li>
			</ul>
			<h1>Interface Datefromat</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-8 col-content">
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<span class="target">Datefromat</span>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section ">
							<h3>Methods</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#clonedate" class="tsd-kind-icon">clone<wbr>Date</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#formatdate" class="tsd-kind-icon">format<wbr>Date</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#formateffectivedate" class="tsd-kind-icon">format<wbr>Effective<wbr>Date</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#formathourtime" class="tsd-kind-icon">format<wbr>Hour<wbr>Time</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#formatsecond" class="tsd-kind-icon">format<wbr>Second</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#formattime" class="tsd-kind-icon">format<wbr>Time</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#formattimecompare" class="tsd-kind-icon">format<wbr>Time<wbr>Compare</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#getday" class="tsd-kind-icon">get<wbr>Day</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#getmonthday" class="tsd-kind-icon">get<wbr>Month<wbr>Day</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#getyearday" class="tsd-kind-icon">get<wbr>Year<wbr>Day</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#now" class="tsd-kind-icon">now</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#timetotimestamp" class="tsd-kind-icon">time<wbr>ToTimestamp</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#timezone" class="tsd-kind-icon">time<wbr>Zone</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter"><a href="datefromat.html#timestamptotime" class="tsd-kind-icon">timestamp<wbr>ToTime</a></li>
								<li class="tsd-kind-method tsd-parent-kind-interface"><a href="datefromat.html#timestamptotimestring" class="tsd-kind-icon">timestamp<wbr>ToTime<wbr>String</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Methods</h2>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="clonedate" class="tsd-anchor"></a>
					<h3>clone<wbr>Date</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">clone<wbr>Date<span class="tsd-signature-symbol">(</span>val<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:469</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>val: <span class="tsd-signature-type">Date</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>需要深拷贝的原始时间对象</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Date</span></h4>
							<p>新的时间对象</p>
							<pre><code class="language-typescript">utils.cloneDate(<span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>(<span class="hljs-string">&#x27;2012-11-21&#x27;</span>))</code></pre>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="formatdate" class="tsd-anchor"></a>
					<h3>format<wbr>Date</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">format<wbr>Date<span class="tsd-signature-symbol">(</span>d<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span>, type<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:497</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>d: <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>传入时间</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> type: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>需要转化为什么格式</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
							<pre><code class="language-typescript">formatDate()  <span class="hljs-string">&quot;2017-03-28&quot;</span>
formatDate(<span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>(), <span class="hljs-string">&#x27;datetime&#x27;</span>) <span class="hljs-string">&quot;2017-03-15 15:34&quot;</span></code></pre>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="formateffectivedate" class="tsd-anchor"></a>
					<h3>format<wbr>Effective<wbr>Date</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">format<wbr>Effective<wbr>Date<span class="tsd-signature-symbol">(</span>date<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:485</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> date: <span class="tsd-signature-type">any</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>需要判断格式是否正确的日期</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Date</span></h4>
							<p>返回正确的当前时间对象</p>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="formathourtime" class="tsd-anchor"></a>
					<h3>format<wbr>Hour<wbr>Time</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">format<wbr>Hour<wbr>Time<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, hour<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:445</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>格式化时间 支持自定义格式 参考element-ui的时间格式</p>
								</div>
								<dl class="tsd-comment-tags">
									<dt>author</dt>
									<dd><p>Jarvan</p>
										<pre><code class="language-typescript">utils.formatHourTime(<span class="hljs-number">1587823200000</span>, <span class="hljs-literal">true</span>)    <span class="hljs-comment">// &#x27;2020-04-25 22:00:00&#x27;</span>
utils.formatHourTime(<span class="hljs-number">1587823200000</span>)    <span class="hljs-comment">// &#x27;2020-04-25&#x27;</span></code></pre>
									</dd>
								</dl>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>value: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>传入时间戳 10位 | 13位</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> hour: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>可选参数 是否需要小时、分钟、秒钟</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
							<p>&#39;2020-04-25 22:00:00&#39;</p>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="formatsecond" class="tsd-anchor"></a>
					<h3>format<wbr>Second</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">format<wbr>Second<span class="tsd-signature-symbol">(</span>s<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:567</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>将秒数转为HH:MM:SS格式</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>s: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>:秒数，不是毫秒</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="formattime" class="tsd-anchor"></a>
					<h3>format<wbr>Time</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">format<wbr>Time<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, format<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:430</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>格式化时间 支持自定义格式 参考element-ui的时间格式</p>
								</div>
								<dl class="tsd-comment-tags">
									<dt>author</dt>
									<dd><p>Jarvan</p>
										<table>
											<thead>
												<tr>
													<th>格式</th>
													<th>含义</th>
													<th>备注</th>
													<th>举例</th>
												</tr>
											</thead>
											<tbody><tr>
													<td>yy</td>
													<td>年</td>
													<td></td>
													<td>20</td>
												</tr>
												<tr>
													<td>yyyy</td>
													<td>年</td>
													<td></td>
													<td>2020</td>
												</tr>
												<tr>
													<td>M</td>
													<td>月</td>
													<td>不补0</td>
													<td>5</td>
												</tr>
												<tr>
													<td>MM</td>
													<td>月</td>
													<td></td>
													<td>05</td>
												</tr>
												<tr>
													<td>d</td>
													<td>日</td>
													<td>不补0</td>
													<td>1</td>
												</tr>
												<tr>
													<td>dd</td>
													<td>日</td>
													<td></td>
													<td>01</td>
												</tr>
												<tr>
													<td>D</td>
													<td>日</td>
													<td>一周第几天 周日-周六(0 - 6) 不补0</td>
													<td>3</td>
												</tr>
												<tr>
													<td>DD</td>
													<td>日</td>
													<td></td>
													<td>03</td>
												</tr>
												<tr>
													<td>h</td>
													<td>小时</td>
													<td>12小时制,须和 A 或 a 使用;不补0</td>
													<td>9</td>
												</tr>
												<tr>
													<td>hh</td>
													<td>小时</td>
													<td>12小时制,须和 A 或 a 使用</td>
													<td>09</td>
												</tr>
												<tr>
													<td>H</td>
													<td>小时</td>
													<td>24小时制;不补0</td>
													<td>3</td>
												</tr>
												<tr>
													<td>HH</td>
													<td>小时</td>
													<td>24小时制</td>
													<td>03</td>
												</tr>
												<tr>
													<td>m</td>
													<td>分</td>
													<td>不补0</td>
													<td>4</td>
												</tr>
												<tr>
													<td>mm</td>
													<td>分</td>
													<td></td>
													<td>04</td>
												</tr>
												<tr>
													<td>s</td>
													<td>秒</td>
													<td>不补0</td>
													<td>05</td>
												</tr>
												<tr>
													<td>ss</td>
													<td>秒</td>
													<td></td>
													<td>05</td>
												</tr>
												<tr>
													<td>a</td>
													<td>am/pm</td>
													<td></td>
													<td>am</td>
												</tr>
												<tr>
													<td>A</td>
													<td>AM/PM</td>
													<td></td>
													<td>AM</td>
												</tr>
										</tbody></table>
										<pre><code class="language-typescript">utils.formatTime(<span class="hljs-number">1587823200000</span>, <span class="hljs-string">&#x27;yyyy-MM-dd HH:mm:ss&#x27;</span>)    <span class="hljs-comment">// &#x27;2020-04-25 22:00:00&#x27;</span>
utils.formatTime(<span class="hljs-number">1587823200000</span>, <span class="hljs-string">&#x27;yyyy-MM-dd&#x27;</span>)    <span class="hljs-comment">// &#x27;2020-04-25&#x27;</span>
utils.formatTime(<span class="hljs-number">1587823200</span>, <span class="hljs-string">&#x27;yyyy-M-d&#x27;</span>)    <span class="hljs-comment">// &#x27;2020-4-25&#x27;</span></code></pre>
									</dd>
								</dl>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>value: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>传入时间戳 10位 | 13位</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> format: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>可选参数 传入目标时间格式 默认&#39;yyyy-MM-dd HH:mm:ss&#39;</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
							<p>&#39;2020-04-25 22:00:00&#39;</p>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="formattimecompare" class="tsd-anchor"></a>
					<h3>format<wbr>Time<wbr>Compare</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">format<wbr>Time<wbr>Compare<span class="tsd-signature-symbol">(</span>time<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:511</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>与现在时间做比较</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> time: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>需要比较的时间（秒）</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">void</span></h4>
							<pre><code class="language-typescript"><span class="hljs-number">1</span>分钟内： <span class="hljs-string">&#x27;刚刚&#x27;</span>
<span class="hljs-number">1</span>小时内： <span class="hljs-string">&#x27;xx分钟前&#x27;</span>
<span class="hljs-number">5</span>小时内： <span class="hljs-string">&#x27;xx小时前&#x27;</span>
超过<span class="hljs-number">5</span>小时但在今日内： <span class="hljs-string">&#x27;今日 hh:mm&#x27;</span>
其他时间：<span class="hljs-string">&#x27;DD-MM hh:mm&#x27;</span></code></pre>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="getday" class="tsd-anchor"></a>
					<h3>get<wbr>Day</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">get<wbr>Day<span class="tsd-signature-symbol">(</span>addDayCount<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, appointedDate<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Date</span>, type<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:520</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>获取指定日期前后n天的日期,如果没有指定日期，则是当前日期n天的前后</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>addDayCount: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>前后n天</p>
									</div>
								</li>
								<li>
									<h5>appointedDate: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Date</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>指定日期</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> type: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>返回时间类型，可选</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="getmonthday" class="tsd-anchor"></a>
					<h3>get<wbr>Month<wbr>Day</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">get<wbr>Month<wbr>Day<span class="tsd-signature-symbol">(</span>monthNum<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, appointedDate<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Date</span>, type<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:529</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>获取指定日期前后n个月的日期,如果没有指定日期，则是当前日期的前后n个月</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>monthNum: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>前后n月</p>
									</div>
								</li>
								<li>
									<h5>appointedDate: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Date</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>指定日期</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> type: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>返回时间类型，可选</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="getyearday" class="tsd-anchor"></a>
					<h3>get<wbr>Year<wbr>Day</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">get<wbr>Year<wbr>Day<span class="tsd-signature-symbol">(</span>addYearCount<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, appointedDate<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, type<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:538</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>获取指定日期前后n年的日期,如果没有指定日期，则是当前日期n年的前后</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>addYearCount: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>前后的n年</p>
									</div>
								</li>
								<li>
									<h5>appointedDate: <span class="tsd-signature-type">any</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>指定日期</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> type: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>返回日期格式</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="now" class="tsd-anchor"></a>
					<h3>now</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">now<span class="tsd-signature-symbol">(</span>long<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:459</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>返回当前系统时间</p>
								</div>
								<dl class="tsd-comment-tags">
									<dt>author</dt>
									<dd><p>Jarvan</p>
										<pre><code class="language-typescript">utils.now()      <span class="hljs-comment">// 1587823200</span>
utils.now(<span class="hljs-literal">true</span>)  <span class="hljs-comment">// 1587823200000</span></code></pre>
									</dd>
								</dl>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> long: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">true</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>是否需要 10位或者13位时间戳 默认为 10位时间戳</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
							<p>&#39;1587823200&#39;</p>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="timetotimestamp" class="tsd-anchor"></a>
					<h3>time<wbr>ToTimestamp</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">time<wbr>ToTimestamp<span class="tsd-signature-symbol">(</span>time<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:560</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>将日期转换为时间戳的格式</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>time: <span class="tsd-signature-type">string</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="timezone" class="tsd-anchor"></a>
					<h3>time<wbr>Zone</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">time<wbr>Zone<span class="tsd-signature-symbol">(</span>time<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:479</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>time: <span class="tsd-signature-type">Date</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>需要转化的时间</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Date</span></h4>
							<p>格林尼治时间对象</p>
							<pre><code class="language-typescript">utils.timeZone(<span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>(<span class="hljs-string">&#x27;2012-12-21&#x27;</span>))</code></pre>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter">
					<a name="timestamptotime" class="tsd-anchor"></a>
					<h3>timestamp<wbr>ToTime</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter">
						<li class="tsd-signature tsd-kind-icon">timestamp<wbr>ToTime&lt;T&gt;<span class="tsd-signature-symbol">(</span>timestamp<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">T</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:545</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>将时间戳转换为日期格式</p>
								</div>
							</div>
							<h4 class="tsd-type-parameters-title">Type parameters</h4>
							<ul class="tsd-type-parameters">
								<li>
									<h4>T</h4>
								</li>
							</ul>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>timestamp: <span class="tsd-signature-type">T</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">T</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
					<a name="timestamptotimestring" class="tsd-anchor"></a>
					<h3>timestamp<wbr>ToTime<wbr>String</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
						<li class="tsd-signature tsd-kind-icon">timestamp<wbr>ToTime<wbr>String<span class="tsd-signature-symbol">(</span>timestamp<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span>, type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in src/types/index.ts:553</li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<dl class="tsd-comment-tags">
									<dt>description:</dt>
									<dd><p>将时间戳转成指定的格式</p>
									</dd>
								</dl>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>timestamp: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>时间戳</p>
									</div>
								</li>
								<li>
									<h5>type: <span class="tsd-signature-type">string</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>:&#39;yyyy-MM-dd HH:mm&#39;, &#39;yyyy-MM-dd&#39; 这两种格式</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
						</li>
					</ul>
				</section>
			</section>
		</div>
		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary">
				<ul>
					<li class="globals  ">
						<a href="../globals.html"><em>Globals</em></a>
					</li>
				</ul>
			</nav>
			<nav class="tsd-navigation secondary menu-sticky">
				<ul class="before-current">
				</ul>
				<ul class="current">
					<li class="current tsd-kind-interface">
						<a href="datefromat.html" class="tsd-kind-icon">Datefromat</a>
						<ul>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#clonedate" class="tsd-kind-icon">clone<wbr>Date</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#formatdate" class="tsd-kind-icon">format<wbr>Date</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#formateffectivedate" class="tsd-kind-icon">format<wbr>Effective<wbr>Date</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#formathourtime" class="tsd-kind-icon">format<wbr>Hour<wbr>Time</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#formatsecond" class="tsd-kind-icon">format<wbr>Second</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#formattime" class="tsd-kind-icon">format<wbr>Time</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#formattimecompare" class="tsd-kind-icon">format<wbr>Time<wbr>Compare</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#getday" class="tsd-kind-icon">get<wbr>Day</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#getmonthday" class="tsd-kind-icon">get<wbr>Month<wbr>Day</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#getyearday" class="tsd-kind-icon">get<wbr>Year<wbr>Day</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#now" class="tsd-kind-icon">now</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#timetotimestamp" class="tsd-kind-icon">time<wbr>ToTimestamp</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#timezone" class="tsd-kind-icon">time<wbr>Zone</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter">
								<a href="datefromat.html#timestamptotime" class="tsd-kind-icon">timestamp<wbr>ToTime</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-interface">
								<a href="datefromat.html#timestamptotimestring" class="tsd-kind-icon">timestamp<wbr>ToTime<wbr>String</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
					<li class=" tsd-kind-interface">
						<a href="format.html" class="tsd-kind-icon">Format</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="index.html" class="tsd-kind-icon">Index</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="is.html" class="tsd-kind-icon">Is</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="lodashtool.html" class="tsd-kind-icon">Lodash<wbr>Tool</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="math.html" class="tsd-kind-icon">Math</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="method.html" class="tsd-kind-icon">Method</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="url.html" class="tsd-kind-icon">Url</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="uuid.html" class="tsd-kind-icon">Uuid</a>
					</li>
					<li class=" tsd-kind-interface">
						<a href="verify.html" class="tsd-kind-icon">Verify</a>
					</li>
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer class="with-border-bottom">
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="container tsd-generator">
	<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>